package com.atguigu.lease.common.minio;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * minio配置类
 */
@Configuration
public class MinioConfiguration {
    @Autowired
    private MinioPropertis minioPropertis;

    /**
     * 创建minioClient
     * @return
     */
    @Bean
    public MinioClient minioClient(){

        return MinioClient.builder().endpoint(minioPropertis.getEndpoint())
                .credentials(minioPropertis.getAccessKey(), minioPropertis.getSecretKey())
                .build();
    }
}
